package com.jy.horny.adapter

import com.jy.horny.base.adpater.BaseRecyclerAdapter
import com.jy.horny.databinding.ItemStringPureBinding

class StringPureAdapter : BaseRecyclerAdapter<String, ItemStringPureBinding>(ItemStringPureBinding::inflate) {
    private var callback: ((String) -> Unit?)? =null
    override fun onBindView(holder: VH<ItemStringPureBinding>, position: Int, item: String?) {
        holder.binding.tvText.text =item
        holder.binding.tvText.setOnClickListener {
            callback?.invoke(item.toString())
        }
    }

    fun setListener(callback:(reason: String)->Unit){
        this.callback = callback
    }
}